import { useState, useRef } from 'react';
import Chirlren from './chirlren.tsx';
const DefaultList = () => {
  const [obj, setobj] = useState({ name: 'zhangsan', age: 18 });
  const refchirlren = useRef(null);
  function handleClick(e, j) {
    console.log(j, 'e');
    console.log(e, 'e');
    console.log('----', refchirlren);
    console.log('----', refchirlren.current?.handleChildren());
  }
  return (
    <div className="default-list">
      标准列表111-----{obj.name}-----{obj.age}----2222
      <Chirlren ref={refchirlren}></Chirlren>
      <div>
        <button onClick={(e) => handleClick(e, 213)}>新增</button>
      </div>
    </div>
  );
};

export default DefaultList;
